package com.ruoyi.binding.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.binding.mapper.AmRuleBindingMapper;
import com.ruoyi.binding.domain.AmRuleBinding;
import com.ruoyi.binding.service.IAmRuleBindingService;

/**
 * 分佣规则和房源绑定Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-28
 */
@Service
public class AmRuleBindingServiceImpl implements IAmRuleBindingService 
{
    @Autowired
    private AmRuleBindingMapper amRuleBindingMapper;

    /**
     * 查询分佣规则和房源绑定
     * 
     * @param id 分佣规则和房源绑定ID
     * @return 分佣规则和房源绑定
     */
    @Override
    public AmRuleBinding selectAmRuleBindingById(Long id)
    {
        return amRuleBindingMapper.selectAmRuleBindingById(id);
    }

    /**
     * 查询分佣规则和房源绑定列表
     * 
     * @param amRuleBinding 分佣规则和房源绑定
     * @return 分佣规则和房源绑定
     */
    @Override
    public List<AmRuleBinding> selectAmRuleBindingList(AmRuleBinding amRuleBinding)
    {
        return amRuleBindingMapper.selectAmRuleBindingList(amRuleBinding);
    }

    /**
     * 新增分佣规则和房源绑定
     * 
     * @param amRuleBinding 分佣规则和房源绑定
     * @return 结果
     */
    @Override
    public int insertAmRuleBinding(AmRuleBinding amRuleBinding)
    {
        amRuleBinding.setCreateTime(DateUtils.getNowDate());
        return amRuleBindingMapper.insertAmRuleBinding(amRuleBinding);
    }

    /**
     * 修改分佣规则和房源绑定
     * 
     * @param amRuleBinding 分佣规则和房源绑定
     * @return 结果
     */
    @Override
    public int updateAmRuleBinding(AmRuleBinding amRuleBinding)
    {
        return amRuleBindingMapper.updateAmRuleBinding(amRuleBinding);
    }

    /**
     * 批量删除分佣规则和房源绑定
     * 
     * @param ids 需要删除的分佣规则和房源绑定ID
     * @return 结果
     */
    @Override
    public int deleteAmRuleBindingByIds(Long[] ids)
    {
        return amRuleBindingMapper.deleteAmRuleBindingByIds(ids);
    }

    /**
     * 删除分佣规则和房源绑定信息
     * 
     * @param id 分佣规则和房源绑定ID
     * @return 结果
     */
    @Override
    public int deleteAmRuleBindingById(Long id)
    {
        return amRuleBindingMapper.deleteAmRuleBindingById(id);
    }
}
